<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('规格列表')" />
</head>
<body class="gray-bg">
     <input type="hidden" id="rowIds">
     <div class="container-div">
		<div class="row">
		       <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <input type="hidden" name="attrType" value="0"/>
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>规格名称：</label>
                                <input type="text" id="attrName" name="attrName"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
			<div class="col-sm-12 select-table table-bordered">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "shop/attr";
        $(function() {
            var options = {
                url: prefix + "/list",
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
                columns: [{
		            radio: true
		        },
				{
                    field: 'attrName',
                    title: '规格名称',
                    align: 'center'
                },
                {
                    field: 'attrValues',
                    title: '规格可选值',
                    align: 'center',
                }]
            };
            $.table.init(options);
        });
        
		/* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
		function getSelections() {
			return $("#" + table.options.id).bootstrapTable('getSelections');
		}

    </script>
</body>
</html>